
function right_menu_over(mobj) {
    mobj.style.backgroundImage = "url(images/right_menu_bk_01_over.gif)";
}
function right_menu_out(mobj) {
    mobj.style.backgroundImage = "url(images/right_menu_bk_01.gif)";
}
function right_menu_clk(sUrl) {
    parent.mainFrm.location.href = sUrl;
    //top.mainFrm.location.href = sUrl;
}
function img_over(imgObj) {
    var imgUrl = imgObj.src;
    imgUrl = imgUrl.substring(imgUrl.indexOf("images/"));
    imgUrl = imgUrl.substring(0, imgUrl.indexOf(".")) + "_over" + imgUrl.substring(imgUrl.indexOf("."));
    imgObj.src = imgUrl;
    return true;
}
function img_out(imgObj) {
    var imgUrl = imgObj.src;
    imgUrl = imgUrl.substring(imgUrl.indexOf("images/"));
    imgUrl = imgUrl.replace("_over", "");
    imgObj.src = imgUrl;
    return true;
}
function showCalenderInput(strDateFd, strForm, bVal, mtype) {
    var strRet = "";
    var initLen = "20";
     var stylevar = "background-color:#EDEDE8";
    var initVal = bVal;
    if (mtype == 1) {
        initLen = "10";
        if (initVal.length > 10) {
            initVal = initVal.substring(0, 10);
        }
    }
    if (mtype == 2) {
        initLen = "8";
        if (initVal.length > 13) {
            initVal = initVal.substring(11);
        }
    }
    strRet += "<input type=\"text\" name=\"" + strDateFd + "\" class=\"inputbox\" maxlength=\"" + initLen + "\" size=\"" + initLen + "\" readonly value=\"" + initVal + "\"  style=\"" + stylevar+ "\"> ";
    strRet += "<img src=\"images/page_img/calendar.gif\" style=\"cursor:hand;\" align=\"absmiddle\" onmouseover=\"calendarMouseOver(this);\" ";
    strRet += "onmouseout=\"calendarMouseOut(this);\" onclick=\"showCalendar(" + strForm + "." + strDateFd + "," + mtype + ",'" + bVal + "');\" title=\"\u8bf7\u9009\u62e9\u65f6\u95f4\uff01\">";
    return strRet;
}
function showCalendar(mobj, strType, initVal) {
    var winPerporty = "dialogHeight: 250px;dialogWidth: 340px;dialogHide:no;center:yes;status:no;help: no";
    var strRet = window.showModalDialog("../js/Calendar.htm", mobj.value, winPerporty);
    if (strRet!==null) {
        if (strType === 0) {
            mobj.value = strRet;
        }
        if (strType == 1) {
            mobj.value = strRet.substring(0, strRet.indexOf(" "));
        }
        if (strType == 2) {
            mobj.value = strRet.substring(strRet.indexOf(" ") + 1);
        }
    }
}
function calendarMouseOver(mobj) {
    mobj.style.filter = "Alpha(Opacity=50)";
}
function calendarMouseOut(mobj) {
    mobj.style.filter = "Alpha(Opacity=100)";
}
function getPageInfo() {
	//????0????????????1??????????????2??????????3????????????????[4]??????????
	var page_b = 0;
    var args = getPageInfo.arguments;
    var argv = getPageInfo.arguments.length;
    var rscnt = args[0];
    var rs_perpage = args[1];
    var page = args[2];
    var pages = args[3];
    var page_cnt = (rscnt % rs_perpage > 0) ? parseInt(rscnt / rs_perpage) + 1 : parseInt(rscnt / rs_perpage);
    page = (page <= 0) ? 1 : page;
    page = (page <= page_cnt) ? page : page_cnt;
    page_b = (page % pages > 0) ? parseInt(page / pages) * pages + 1 : (parseInt(page / pages) - 1) * pages + 1;
    page_b = (page_b <= 0) ? 1 : page_b;
    var img_url = (argv > 4) ? args[4] : "../images/page_img";
    var img_frist = img_url + "/icon_page_frist.gif";
    var img_prevs = img_url + "/icon_page_prevs.gif";
    var img_prev = img_url + "/icon_page_prev.gif";
    var img_next = img_url + "/icon_page_next.gif";
    var img_nexts = img_url + "/icon_page_nexts.gif";
    var img_last = img_url + "/icon_page_last.gif";
    var img_goto = img_url + "/btn_goto.gif";
    var strForm = (argv > 5) ? args[5] : "document.listForm";
    var r = "<font color=\"#333333\">";
    r += "\u5171&nbsp;" + rscnt + "&nbsp;\u6761\u8bb0\u5f55&nbsp;&nbsp;&nbsp;\u7b2c&nbsp;" + page + "&nbsp;\u9875&nbsp;\uff5c&nbsp;\u5171&nbsp;" + page_cnt + "&nbsp;\u9875&nbsp;&nbsp;";
    if (page > 1) {
        r += "&nbsp;<img src=\"" + img_frist + "\" style=\"cursor:hand;\" onclick=\"goto_page(" + strForm + ",1);\" title=\"\u5230\u7b2c\u4e00\u9875\">";
    } else {
        r += "&nbsp;<img src=\"" + img_frist + "\" title=\"\u5230\u7b2c\u4e00\u9875\">&nbsp;";
    }
    if (page > pages) {
        r += "&nbsp;<img src=\"" + img_prevs + "\" style=\"cursor:hand;\" onclick=\"goto_page(" + strForm + "," + (page - pages) + ");\" title=\"\u5230\u524d" + pages + "\u9875\">";
    } else {
        r += "&nbsp;<img src=\"" + img_prevs + "\" title=\"\u5230\u524d" + pages + "\u9875\">&nbsp;";
    }
    if (page > 1) {
        r += "&nbsp;<img src=\"" + img_prev + "\" style=\"cursor:hand;\" onclick=\"goto_page(" + strForm + "," + (page - 1) + ");\" title=\"\u5230\u524d\u4e00\u9875\">";
    } else {
        r += "&nbsp;<img src=\"" + img_prev + "\" title=\"\u5230\u524d\u4e00\u9875\">&nbsp;&nbsp;";
    }
    for (var i = page_b; i < page_b + pages; i = i + 1) {
        if (i <= page_cnt) {
            if (i != page) {
                r += "&nbsp;<font style=\"cursor:hand;\" onclick=\"goto_page(" + strForm + "," + i + ");\">" + i + "</font>";
            } else {
                r += "&nbsp;<font color=\"red\">" + i + "</font>";
            }
        }
    }
    if (page < page_cnt) {
        r += "&nbsp;&nbsp;<img src=\"" + img_next + "\" style=\"cursor:hand;\" onclick=\"goto_page(" + strForm + "," + (page + 1) + ");\" title=\"\u5230\u540e\u4e00\u9875\">";
    } else {
        r += "&nbsp;&nbsp;<img src=\"" + img_next + "\" title=\"\u5230\u540e\u4e00\u9875\">";
    }
    if (page_b + pages < page_cnt) {
        r += "&nbsp;&nbsp;<img src=\"" + img_nexts + "\" style=\"cursor:hand;\" onclick=\"goto_page(" + strForm + "," + (page + pages) + ");\" title=\"\u5230\u540e" + pages + "\u9875\">";
    } else {
        r += "&nbsp;&nbsp;<img src=\"" + img_nexts + "\" title=\"\u5230\u540e" + pages + "\u9875\">";
    }
    if (page < page_cnt) {
        r += "&nbsp;&nbsp;<img src=\"" + img_last + "\" style=\"cursor:hand;\" onclick=\"goto_page(" + strForm + "," + page_cnt + ");\" title=\"\u5230\u6700\u540e\u4e00\u9875\">";
    } else {
        r += "&nbsp;&nbsp;<img src=\"" + img_last + "\" title=\"\u5230\u6700\u540e\u4e00\u9875\">";
    }
    r += "<input type=\"hidden\" name=\"page\" id=\"page\" value=\"" + page + "\">";
    r += "&nbsp;&nbsp;<input type=\"text\" name=\"page_id\" id=\"page_id\" style=\"font-family: \u5b8b\u4f53;font-size:12px;line-height:14px;height:18px;width:30px;border:1px solid #333333;text-align: center;\" size=\"3\" maxlength=\"3\" onkeydown=\"if(event.keyCode==13 && chk_num(" + strForm + ")) " + strForm + ".submit();\" value=\"" + page + "\"> \u9875</font>";
    r += "&nbsp;&nbsp;<img src=\"" + img_goto + "\" style=\"Cursor:hand;\" onclick=\"if (chk_num(" + strForm + ")) " + strForm + ".submit();\" onmouseover=\"img_over(this);\" onmouseout=\"img_out(this);\" align=\"absmiddle\">";
    return r;
}
function goto_page(oForm, id) {
    oForm.page.value = id;
    oForm.submit();
    return;
}
function showAlert(strMsg) {
    showAlert(strMsg);
}
function chk_num(oForm) {
    var mobj = oForm.page_id;
    var my_str = mobj.value;
    if (my_str.length <= 0) {
        showAlert("\u8bf7\u8f93\u5165\u9875\u6570\uff01", "");
        mobj.focus();
        return false;
    }
    for (var i = 0; i < my_str.length; i = i + 1) {
        var mstr = my_str.substring(i, i + 1);
        if (mstr < "0" || mstr > "9") {
            showAlert("\u9875\u6570\u9519\u8bef\uff01", "");
            mobj.focus();
            return false;
        }
    }
    oForm.page.value = my_str;
    return true;
}

